﻿namespace Owin
{
    using Jhong.StaticFile;

    public static class AppBuilderExtension
    {
        public static void UseStaticFile(this IAppBuilder app, string[] directoryOrFile)
        {
            UseStaticFile(app, directoryOrFile, new StaticFileOption() { CaseSensitive = true });
        }

        public static void UseStaticFile(this IAppBuilder app, string[] directoryOrFile, StaticFileOption option)
        {
            StaticFileHandler.Option = option;
            StaticFileHandler.AddPath(directoryOrFile);
            app.Use(typeof(StaticFileMiddleware));
        }
    }
}